package com.vchello.bean.security;

import java.io.Serializable;

import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.vchello.bean.user.User;

/**
 * 
 * @author jun 用户权限
 */
@TableName("user_role")
public class UserRole extends Model<UserRole>{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	@TableId("id")
	private int id;

	@TableField("user_id")
	private int userId;

	@TableField("role_id")
	private int roleId;

	@TableField("father_id")
	private int fatherId;

	@TableField(exist = false)
	private Role role;

	@TableField(exist = false)
	private User user;

	@TableField(exist = false)
	private User fatherUser;
	
	public UserRole(){}
	
	public UserRole(int userId, int roleId, int fatherId) {
		super();
		this.userId = userId;
		this.roleId = roleId;
		this.fatherId = fatherId;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public int getUserId() {
		return userId;
	}

	public void setUserId(int userId) {
		this.userId = userId;
	}

	public int getRoleId() {
		return roleId;
	}

	public void setRoleId(int roleId) {
		this.roleId = roleId;
	}

	public int getFatherId() {
		return fatherId;
	}

	public void setFatherId(int fatherId) {
		this.fatherId = fatherId;
	}

	public Role getRole() {
		return role;
	}

	public void setRole(Role role) {
		this.role = role;
	}

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public User getFatherUser() {
		return fatherUser;
	}

	public void setFatherUser(User fatherUser) {
		this.fatherUser = fatherUser;
	}

	@Override
	protected Serializable pkVal() {
		return this.id;
	}

}
